<?php

namespace App\Jobs;

use App\Notifications\Wechat\CourseEnd;

class CourseEndJob extends Job
{
    protected $userId;
    protected $courseLevel;
    protected $datetime;
    protected $nextCourseId;
    protected $seriesName;

    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct($userId, $courseLevel, $datetime, $nextCourseId, $seriesName)
    {
        $this->userId = $userId;
        $this->courseLevel = $courseLevel;
        $this->datetime = $datetime;
        $this->nextCourseId = $nextCourseId;
        $this->seriesName = $seriesName;
    }

    public function handle() {
        $courseEnd = new CourseEnd();
        $courseEnd->notify(
            $this->userId,
            $this->courseLevel,
            $this->datetime,
            $this->nextCourseId,
            $this->seriesName
        );
    }
}
